package cn.cdut.yiwenqian.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * CdutPostMessages entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "CDUT_POST_MESSAGES", catalog = "cdutpostbar")
public class CdutPostMessages implements java.io.Serializable {

	// Fields

	private Integer unumber;
	private CdutPostUsers cdutPostUsersByAuther;
	private CdutPostUsers cdutPostUsersBySender;
	private String typecode;
	private String content;
	private String isactive;
	private Date beginDate;

	// Constructors

	/** default constructor */
	public CdutPostMessages() {
	}

	/** minimal constructor */
	public CdutPostMessages(Integer unumber) {
		this.unumber = unumber;
	}

	/** full constructor */
	public CdutPostMessages(Integer unumber,
			CdutPostUsers cdutPostUsersByAuther,
			CdutPostUsers cdutPostUsersBySender, String typecode,
			String content, String isactive, Date beginDate) {
		this.unumber = unumber;
		this.cdutPostUsersByAuther = cdutPostUsersByAuther;
		this.cdutPostUsersBySender = cdutPostUsersBySender;
		this.typecode = typecode;
		this.content = content;
		this.isactive = isactive;
		this.beginDate = beginDate;
	}

	// Property accessors
	@Id
	@GeneratedValue(generator="messageIdGenerator")
	@GenericGenerator(name="messageIdGenerator",strategy="increment")
	@Column(name = "unumber", unique = true, nullable = false)
	public Integer getUnumber() {
		return this.unumber;
	}

	public void setUnumber(Integer unumber) {
		this.unumber = unumber;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "auther")
	public CdutPostUsers getCdutPostUsersByAuther() {
		return this.cdutPostUsersByAuther;
	}

	public void setCdutPostUsersByAuther(CdutPostUsers cdutPostUsersByAuther) {
		this.cdutPostUsersByAuther = cdutPostUsersByAuther;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sender")
	public CdutPostUsers getCdutPostUsersBySender() {
		return this.cdutPostUsersBySender;
	}

	public void setCdutPostUsersBySender(CdutPostUsers cdutPostUsersBySender) {
		this.cdutPostUsersBySender = cdutPostUsersBySender;
	}

	@Column(name = "typecode", length = 1)
	public String getTypecode() {
		return this.typecode;
	}

	public void setTypecode(String typecode) {
		this.typecode = typecode;
	}

	@Column(name = "content", length = 128)
	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	@Column(name = "isactive", length = 1)
	public String getIsactive() {
		return this.isactive;
	}

	public void setIsactive(String isactive) {
		this.isactive = isactive;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "beginDate", length = 10)
	public Date getBeginDate() {
		return this.beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

}